<?php


/*
* Copyright (c) 2008-2016 vip.com, All Rights Reserved.
*
* Powered by com.vip.osp.osp-idlc-2.5.11.
*
*/

namespace com\vip\vipcard;

class UpdateCardUseStopTimeReqModel {
	
	static $_TSPEC;
	public $signModel = null;
	public $userVipcardIds = null;
	public $useStopTime = null;
	public $clientJsonMsg = null;
	public $remark = null;
	
	public function __construct($vals=null){
		
		if (!isset(self::$_TSPEC)){
			
			self::$_TSPEC = array(
			101 => array(
			'var' => 'signModel'
			),
			2 => array(
			'var' => 'userVipcardIds'
			),
			3 => array(
			'var' => 'useStopTime'
			),
			4 => array(
			'var' => 'clientJsonMsg'
			),
			5 => array(
			'var' => 'remark'
			),
			
			);
			
		}
		
		if (is_array($vals)){
			
			
			if (isset($vals['signModel'])){
				
				$this->signModel = $vals['signModel'];
			}
			
			
			if (isset($vals['userVipcardIds'])){
				
				$this->userVipcardIds = $vals['userVipcardIds'];
			}
			
			
			if (isset($vals['useStopTime'])){
				
				$this->useStopTime = $vals['useStopTime'];
			}
			
			
			if (isset($vals['clientJsonMsg'])){
				
				$this->clientJsonMsg = $vals['clientJsonMsg'];
			}
			
			
			if (isset($vals['remark'])){
				
				$this->remark = $vals['remark'];
			}
			
			
		}
		
	}
	
	
	public function getName(){
		
		return 'UpdateCardUseStopTimeReqModel';
	}
	
	public function read($input){
		
		$input->readStructBegin();
		while(true){
			
			$schemeField = $input->readFieldBegin();
			if ($schemeField == null) break;
			$needSkip = true;
			
			
			if ("signModel" == $schemeField){
				
				$needSkip = false;
				
				$this->signModel = new \com\vip\vipcard\SignModel();
				$this->signModel->read($input);
				
			}
			
			
			
			
			if ("userVipcardIds" == $schemeField){
				
				$needSkip = false;
				$input->readString($this->userVipcardIds);
				
			}
			
			
			
			
			if ("useStopTime" == $schemeField){
				
				$needSkip = false;
				$input->readString($this->useStopTime);
				
			}
			
			
			
			
			if ("clientJsonMsg" == $schemeField){
				
				$needSkip = false;
				$input->readString($this->clientJsonMsg);
				
			}
			
			
			
			
			if ("remark" == $schemeField){
				
				$needSkip = false;
				$input->readString($this->remark);
				
			}
			
			
			
			if($needSkip){
				
				\Osp\Protocol\ProtocolUtil::skip($input);
			}
			
			$input->readFieldEnd();
		}
		
		$input->readStructEnd();
		
		
		
	}
	
	public function write($output){
		
		$xfer = 0;
		$xfer += $output->writeStructBegin();
		
		$xfer += $output->writeFieldBegin('signModel');
		
		if (!is_object($this->signModel)) {
			
			throw new \Osp\Exception\OspException('Bad type in structure.', \Osp\Exception\OspException::INVALID_DATA);
		}
		
		$xfer += $this->signModel->write($output);
		
		$xfer += $output->writeFieldEnd();
		
		$xfer += $output->writeFieldBegin('userVipcardIds');
		$xfer += $output->writeString($this->userVipcardIds);
		
		$xfer += $output->writeFieldEnd();
		
		$xfer += $output->writeFieldBegin('useStopTime');
		$xfer += $output->writeString($this->useStopTime);
		
		$xfer += $output->writeFieldEnd();
		
		$xfer += $output->writeFieldBegin('clientJsonMsg');
		$xfer += $output->writeString($this->clientJsonMsg);
		
		$xfer += $output->writeFieldEnd();
		
		if($this->remark !== null) {
			
			$xfer += $output->writeFieldBegin('remark');
			$xfer += $output->writeString($this->remark);
			
			$xfer += $output->writeFieldEnd();
		}
		
		
		$xfer += $output->writeFieldStop();
		$xfer += $output->writeStructEnd();
		return $xfer;
	}
	
}

?>